Distinct Opposite Sums Codechef Starters 79 (Rated till 5 Stars) problem solution.
This post is all about the solution of the Distinct Opposite Sums Codechef Starters 79 (Rated till 5 Stars) problem solution.
Problem Statement:
Given an even integer N, generate a permutation P of length N such that:
There is always the possibility of a solution. If there are multiple such permutations, print any of them. It is worth noting that a permutation P of length N contains all integers from N exactly once. [2,1,3,4] is an example of a permutation
Format of Input :
The number of cases will be indicated by a single integer TT in the first line of input.
Each test case's first and only line includes 2 space-separated integers NN and MM — the number of apples and oranges, respectively.
Format of the Output :
For every test case, output YES if the group is perfect and NO or else on a new line.
Each character can be printed in either uppercase or lowercase. The strings YES, yes, Yes, and yES, for example, are all considered identical.
0 Comments